package com.kupurui.asteacher.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.android.frame.adapter.CommonAdapter;
import com.android.frame.adapter.ViewHolder;
import com.facebook.drawee.view.SimpleDraweeView;
import com.kupurui.asteacher.R;
import com.kupurui.asteacher.bean.CorrectDetailsInfo;
import com.kupurui.asteacher.bean.CorrectInfo;

import java.util.List;

/**
 * 批改了的
 *
 * Created by Administrator on 2017/7/25.
 */

public class CorrectAdapter extends CommonAdapter<CorrectDetailsInfo.YiPigaiBean> {
    public CorrectAdapter(Context context, List<CorrectDetailsInfo.YiPigaiBean> mList, int itemLayoutId) {
        super(context, mList, itemLayoutId);
    }

    @Override
    public void convert(ViewHolder holder, CorrectDetailsInfo.YiPigaiBean item, int positon) {
        ImageView ivStatus = holder.getView(R.id.iv_status);
        holder.setImageByUrl(R.id.imgv_head,item.getImg());
        holder.setTextViewText(R.id.tv_name,item.getName());

        if (item.getStatus().equals("0")){
            ivStatus.setImageResource(R.drawable.imgv_errors_little);
        }else if(item.getStatus().equals("2")){
            ivStatus.setImageResource(R.drawable.imgv_correct_little);
        }else if(item.getStatus().equals("3")){
            ivStatus.setImageResource(R.drawable.imgv_half_correct_little);
        }
    }
}
